package com.jtjrenren.android.taxi.passenger.utils;

import android.widget.Toast;

import com.jtjrenren.android.taxi.passenger.base.BaseApplication;
import com.library.utils.LogUtil;

import java.net.SocketTimeoutException;

/**
 * Created by Administrator on 2016/9/6.
 */

public class ExceptionHand {
    public static void handException(Throwable e) {
        handException(e, true);
    }

    public static void handException(Throwable e, boolean isShow) {
        LogUtil.log("app_exception", "Exception:" + e.toString());

        if (e instanceof SocketTimeoutException && isShow) {
            Toast.makeText(BaseApplication.getInstance().getApplicationContext(), "网络繁忙，请稍候再试..",
                    Toast.LENGTH_SHORT).show();
        }
    }
}
